package Homework2;

import java.util.Scanner;

public class Homework2_1 {
    public static void main(String[] args) {
        Scanner input = new Scanner(System.in);
        String s = input.nextLine();
        int count1 = 0, count2 = 0, count3 = 0, elsecount = 0;
        for (int i = 0; i < s.length(); i++){
            if (Character.isUpperCase(s.charAt(i))){
                count1++;
            } else if (Character.isLowerCase(s.charAt(i))){
                count2++;
            } else if (Character.isDigit(s.charAt(i))) {
                count3++;
            }else {
                elsecount++;
            }
        }
        System.out.println(count1 + " " + count2 + " " + count3 + " " + elsecount);
    }

}
